#include "getapplicationfromserver.h"


GetApplicationFromServer::GetApplicationFromServer(const Id& id)
{
    m_messageType = MessageType::GetFriendApplication;
    m_id = id;
}

GetApplicationFromServer::GetApplicationFromServer(const QJsonObject& jsonObj)
{
    m_messageType = static_cast<MessageType>(jsonObj[JsonKey::TYPE].toInt());
    m_id = jsonObj[JsonKey::ID].toInt();
}

QJsonObject GetApplicationFromServer::PackJsonData() const
{
    QJsonObject jsonObj;
    jsonObj[JsonKey::TYPE] = static_cast<int>(m_messageType);
    jsonObj[JsonKey::ID] = m_id;
    return jsonObj;
}

Id GetApplicationFromServer::getId() const
{
    return m_id;
}
